from PyQt5.QtWidgets import *

def show_info_messagebox(title="Information MessageBox", message="Information", buttons=QMessageBox.Ok, detailed_text:None|str=None):
    msg = QMessageBox()
    msg.setIcon(QMessageBox.Information)
    msg.setText(message)
    msg.setWindowTitle(title)
    msg.setStandardButtons(buttons)
    if detailed_text:
        msg.setDetailedText(detailed_text)
    retval = msg.exec_()
    return retval

def show_warning_messagebox(title="Warning MessageBox", message="Warning", buttons=QMessageBox.Ok, detailed_text:None|str=None):
    msg = QMessageBox()
    msg.setIcon(QMessageBox.Warning)
    msg.setText(message)
    msg.setWindowTitle(title)
    msg.setStandardButtons(buttons)
    if detailed_text:
        msg.setDetailedText(detailed_text)
    retval = msg.exec_()
    return retval

def show_question_messagebox(title="Question MessageBox", message="Question", buttons=QMessageBox.Ok|QMessageBox.Cancel, detailed_text:None|str=None):
    msg = QMessageBox()
    msg.setIcon(QMessageBox.Question)
    msg.setText(message)
    msg.setWindowTitle(title)
    msg.setStandardButtons(buttons)
    if detailed_text:
        msg.setDetailedText(detailed_text)
    retval = msg.exec_()
    return retval

def show_critical_messagebox(title="Critical MessageBox", message="Critical", buttons=QMessageBox.Ok, detailed_text:None|str=None):
    msg = QMessageBox()
    msg.setIcon(QMessageBox.Critical)
    msg.setText(message)
    msg.setWindowTitle(title)
    msg.setStandardButtons(buttons)
    if detailed_text:
        msg.setDetailedText(detailed_text)
    retval = msg.exec_()
    return retval
